<div class="modal fade bs-modal-lg" id="modelContent">
	<div class="modal-dialog modal-lg">
        <div class="modal-content resultsTable" style="width:1224px;margin-left:-300px;"></div>
    </div>
</div> 
<div class="portlet box green">
	<div class="portlet-title">
	    <div class="caption"><i class="fa fa-cog"></i>关联货品</div>
		<div class="tools">
			<a href="javascript:;" class="collapse right" data-original-title="" title=""> </a>
			<!-- <a href="" class="fullscreen" data-original-title="" title=""> </a> -->
    	</div>
    	<div class="actions">
			<a href="javascript:;" class="btn white btn-sm ajax-search"><i class="fa fa-search"></i> 查询 </a>
			<a href="javascript:;" class="btn white btn-sm search-reset"><i class="fa fa-eraser"></i> 清除 </a>
			<a href="/productRelevance/list"  class="btn white btn-sm ajaxify"><i class="fa fa-mail-reply"></i>返回</a>
		</div>
	</div>
	<div class="portlet-body ">
	   	<form action="/productRelevance/add" class="form-horizontal" method="get" id="searchForm">
			<div class="form-body">
				<div class="form-group ">
						<div class="col-md-3">
							<label class="control-label col-md-3">货品：</label>
							<div class="col-md-8">
								<input class="form-control" type="text" name="product"   placeholder="输入货品名称或编码" value="$!product">
								<input type="hidden" value="$!productRelevance.id" name="id">
							</div>
						</div>
						<div class="col-md-3">
							<label class="control-label col-md-3">分类：</label>
							<div class="col-md-8">
	 							<select name="categoryId" data-size="8" data-live-search="true" class="form-control bs-select">
	 								<option value="">请选择</option>
	 								#foreach($category in $!categoryList)
	 								<option  #if($!categoryId == $!category.id)  selected="selected" #end value="$!category.id">$!category.name</option>
	 								#end
	 							</select>
							</div>
						</div>
						 <div class="col-md-3">
						 	<label class="control-label col-md-3">品牌:</label>
						 	<div class="col-md-8">
						 		<select name="brandId"  data-size="8" data-live-search="true" class="form-control bs-select">
						 			<option value="">请选择</option>
						 			#foreach($brand in $!brandList)
	 								<option #if($!brandId == $!brand.id) selected="selected" #end value="$!brand.id">$!brand.name</option>
	 								#end
	 							</select>
						 	</div>
						 </div>
					 	<div class="col-md-3">
						 	<label class="control-label col-md-3">标签:</label>
						 	<div class="col-md-8">
						 	 	<select data-live-search="true" data-size="8" class="form-control bs-select" name="label">
						 	 	<option value="">请选择</option>
						 	 	#foreach($label  in $!pLabelList)
						 	 		<option #if($!label.name == $!labels ) selected="selected" #end value="$label.name">$label.name</option>
						 	 	#end
						 	 	</select>
						 	</div>
						</div> 
				</div>
				<div class="form-group ">
						 <div class="col-md-3">
						 	<label class="control-label col-md-3">销量:</label>
						 	<div class="col-md-4">
						 		<input class="form-control" type="number" name="sales"   value="$!sales">
						 	</div>
						 	<div class="col-md-1">～</div>
						 	<div class="col-md-4">
						 		<input  class="form-control" type="number" name="sales2"  value="$!sales2">
						 	</div>
						 </div>
						 <div class="col-md-3">
						 	<label class="control-label col-md-3">售价:</label>
						 	<div class="col-md-4">
						 		<input class="form-control" type="number" name="price"   value="$!price">
						 	</div>
						 	<div class="col-md-1">～</div>
						 	<div class="col-md-4">
						 		<input  class="form-control" type="number" name="price2"  value="$!price2" >
						 	</div>
						 </div>
					 	 <div class="col-md-5">
						 	<label class="control-label col-md-3">创建时间:</label>
						 	<div class="col-md-4">
						 		<input class="form-control" type="text" name="startTime" id="startTime" value="$!startTime" readonly>
								<i class="fa fa-calendar" style="position: absolute;right: 10px;top: 10px"></i>
						 	</div>
						 	<div class="col-md-1">～</div>
						 	<div class="col-md-4">
						 		<input class="form-control" type="text" name="endTime" id="endTime" value="$!endTime" readonly>
								<i class="fa fa-calendar" style="position: absolute;right: 10px;top: 10px"></i>
						 	</div>
						 </div>
				</div>
			</div>
		</form>
	</div>
</div>
<div class="portlet box green">
	<div class="portlet-title">
		<div class="caption"><i class="fa fa-cogs"></i>数据列表</div>
		<div class="tools"><a href="javascript:;" class="collapse" data-original-title="" title=""> </a></div>
		<div class="actions"><a href="#modelContent" thref="/productRelevance/addSure" class="btn white btn-sm ajax-model-get" data-toggle="modal"><i class="fa fa-plus"></i>列表<span class="font-red-flamingo font-min">（$!selectpIdsLen）</span></a></div>
    </div>
	<div class="portlet-body form"  style="padding: 15px!important;">
		<form role="form" action="/productRelevance/add" class="form-horizontal" method="post" id="searchForm" onsubmit="return false">
			<div class="dataTables_wrapper no-footer">
				<div class="table-container table-scrollable">
					<table class="table table-striped table-bordered table-hover icheck-table" id="productTable">
						<tr>
							<th style="width: 20px">
								<input type="checkbox" class="icheck group-icheck" />
							</th>
							<th>货品编码</th>
							<th>货品名称</th>
							<th>分类</th>
							<th>品牌</th>
							<th>售价</th>
							<th>库存</th>
							<th>总销量</th>
							<th>标签</th>
							<th class="col-md-1">操作</th>
						</tr>

						<tbody>
							#foreach ($!item in $!pageProduct.result)
							#set($inventory = $!inventoryMap.get($!item.id))
							<tr class="odd gradeX pro_tr">
								<td>
									<input type="checkbox" name="productIds" class="icheck" value="$!item.id" />
								</td>
								<td>
									<p style="margin: 0">$item.code</p>
								</td>
								<td><a href="/product/preview?id=$!item.id" title="/product/preview?id=$!item.id" target="_blank">$item.name</a></td>
								<td>$!item.category.name</td>
								<td>$!item.brand.name</td>
								<td>$item.salesPrice</td>
								<td>$!inventory</td>
								<td>$!item.salesNum</td>
								<td>$!item.lables</td>
								<td>
									#set($hasPid = false)
									#foreach($selectpId in $selectpIds)
										#if($selectpId == $!item.id)
										#set($hasPid = true)
										#end
									#end
									#if($hasPid)
										<a href="javascript:;"  class="btn btn-sm green btn-outline"><i class="fa fa-plus"></i>已新增 </a>
									#else
									<a href="/productRelevance/add?productIds=$!item.id&pageNo=$pageProduct.pageNo"  class="btn   btn-outline green btn-sm ajaxify"><i class="fa fa-plus"></i> 新增 </a>
									#end
								</td>
							</tr>
							#end
						</tbody>

					</table>

				</div>
				#set($page=$pageProduct)
				#set($pageUrl="/productRelevance/add?&pageNo=")
				#parse("_page.htm")
			</div>
		</form>
		</div>
	</div>
<script type="text/javascript" src="/assets/scripts/views-date.js" ></script>
<script type="text/javascript" src="/assets/scripts/views-icheck.js"></script>
<script type="text/javascript">
	ComponentsSelect2.initWithSearch();
</script>